package com.ripplezjw.blog.controller;

import com.ripplezjw.blog.Service.ClassificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class ClassificationController {
    @Autowired
    ClassificationService classificationService;

    @GetMapping("/clsId/{clsId}")
    public String clsList(@PathVariable("clsId") int clsId,
                          Model model) {
        model.addAttribute("articles", classificationService.getAllArticleIdByClsId(clsId));
        return "articleList";
    }
}
